import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'dnp_plugin_platform_interface.dart';

/// An implementation of [DnpPluginPlatform] that uses method channels.
class MethodChannelDnpPlugin extends DnpPluginPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('dnp_plugin');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }

  @override
  Future<String?> fearlessness() async {
    final fearlessness = await methodChannel.invokeMethod<String>('fearlessness');
    return fearlessness;
  }

  @override
  Future<String?> footed() async {
    final footed = await methodChannel.invokeMethod<String>('footed');
    return footed;
  }

  @override
  Future<String?> holiday() async {
    final holiday = await methodChannel.invokeMethod<String>('holiday');
    return holiday;
  }

  @override
  Future<String?> considerably() async {
    final considerably = await methodChannel.invokeMethod<String>('considerably');
    return considerably;
  }

  @override
  Future<String?> sysName() async {
    final sysName = await methodChannel.invokeMethod<String>('sysName');
    return sysName;
  }

  @override
  Future<String?> cannot() async {
    final cannot = await methodChannel.invokeMethod<String>('cannot');
    return cannot;
  }

  @override
  Future<String?> afford() async {
    final afford = await methodChannel.invokeMethod<String>('afford');
    return afford;
  }

  @override
  Future<String?> largest() async {
    final largest = await methodChannel.invokeMethod<String>('largest');
    return largest;
  }

  @override
  Future<String?> autou() async {
    final autou = await methodChannel.invokeMethod<String>('autou');
    return autou;
  }

  @override
  Future<String?> ten() async {
    final ten = await methodChannel.invokeMethod<String>('ten');
    return ten;
  }

  @override
  Future<String?> should() async {
    final should = await methodChannel.invokeMethod<String>('should');
    return should;
  }

  @override
  Future<String?> finger() async {
    final should = await methodChannel.invokeMethod<String>('finger');
    return should;
  }

  @override
  showToast(String text) {
    methodChannel.invokeMethod("showToast",text);
  }

  @override
  showAlert(String text) {
    methodChannel.invokeMethod("showAlert",text);
  }

  @override
  openHud() {
    methodChannel.invokeMethod("openHud");
  }

  @override
  closeHud() {
    methodChannel.invokeMethod("closeHud");
  }

  @override
  showSKStore() {
    methodChannel.invokeMethod("showSKStore");
  }

  @override
  submitFB(String? ta, String? hou, String? ex, String? panta) {
    var dic = {
      "ta" : ta ?? "",
      "hou" : hou ?? "",
      "ex" : ex ?? "",
      "panta" : panta ?? ""
    };
    methodChannel.invokeMethod('submitFB',dic);
  }

  @override
  Future<Map<dynamic,dynamic>?> get showActionSheet async{
    return await methodChannel.invokeMethod("showActionSheet");
  }

  @override
  Future<Map<dynamic,dynamic>?> get showFrontCamera async {
    return await methodChannel.invokeMethod("showFrontCamera");
  }

  @override
  Future get chooseContact async {
    return await methodChannel.invokeMethod("chooseContact");
  }

  @override
  Future get chooseContactList async {
    return await methodChannel.invokeMethod("chooseContactList");
  }

  @override
  Future<Map<dynamic,dynamic>?> get treasures async {
    return await methodChannel.invokeMethod("treasures");
  }

  @override
  Future<Map<dynamic,dynamic>?> get indescribable async {
    return await methodChannel.invokeMethod("indescribable");
  }

  @override
  Future<Map<dynamic,dynamic>?> get startLocationTracking async {
    return await methodChannel.invokeMethod("startLocationTracking");
  }

  @override
  endLocationTracking() {
    methodChannel.invokeMethod("endLocationTracking");
  }

  @override
  Future<Map<dynamic,dynamic>?> shook() async {
    return await methodChannel.invokeMethod("shook");
  }

  @override
  Future<Map<dynamic,dynamic>?> wire() async {
    return await methodChannel.invokeMethod("wire");
  }

  @override
  Future<bool> isPad() async {
    return await methodChannel.invokeMethod("isPad");
  }
}
